// database.js
require("dotenv").config();
const mysql = require("mysql2");

const connection = mysql.createConnection({
    host: "localhost" || process.env.DB_HOST,
    user: "root" || process.env.DB_USER,
    password: "szt20020901" || process.env.DB_PASSWORD,
    database: "en_words_study_sys" || process.env.DB_NAME,
});

connection.connect((error) => {
    if (error) throw error;
    console.log("Successfully connected to the database.");
});

module.exports = connection;
